﻿using Anke.SHManage.Model;
using Anke.SHManage.MSSQLDAL;
using Anke.SHManage.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Anke.SHManage.BLL
{
    public partial class C_AmbulanceBLL : BaseBLL<C_Ambulance>
    {
        C_AmbulanceDAL m_DAL = new C_AmbulanceDAL();
        //获取基础表最大ID
        public int getMaxID() {
            return m_DAL.getMaxAmbID();
        }

        public object getAmbDate(int page, int rows, string sortName, string sortOrder, ref int total, string zcenterCode, string zstationCode, string zPlateNumber, string zCarNumber, DateTime InsuranceDateStart, DateTime InsuranceDateEnd, DateTime AnnualSurveyDateStart, DateTime AnnualSurveyDateEnd, string isActive, string isReject, string messgeIds, E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            return m_DAL.getAmbDate(page, rows, sortName, sortOrder, ref total, zcenterCode, zstationCode, zPlateNumber, zCarNumber, InsuranceDateStart, InsuranceDateEnd, AnnualSurveyDateStart, AnnualSurveyDateEnd, isActive, isReject, messgeIds, em, selfWorkCode, selfCenterID, selfStationID);
        }

        public void getEditAmb(string ambulanceCode, out C_Ambulance info)
        {

             m_DAL.getEditAmb(ambulanceCode, out info );
        }

        //根据ID查看年检表中是否存在同样ID 的值，如果存在就修改，不存在就新增。
        public bool ifExistAS(string tempID)
        {
            return m_DAL.ifExistAS(tempID);
        }
        
        public C_AnnualSurvey ExistAS(string tempID)
        {
            return m_DAL.ExistAS(tempID);
        }

        //同上，是保险表
        public bool ifExistI(string tempID)
        {
            return m_DAL.ifExistI(tempID);
        }
        public C_Insurance ExistI(string tempID)
        {
            return m_DAL.ExistI(tempID);
        }

        public object getPlateByStationID(string stationCode)
        {
            return m_DAL.getPlateByStationID(stationCode);
        }

        public object getCarNumberByambID(string ID)
        {
            return m_DAL.getCarNumberByambID(ID);
        }


        CMTJDAL cmtdal = new CMTJDAL();
        //保养提醒页面获取列表信息
        public object getAllambMaintain(ref int totals,DateTime beginTime, DateTime endTime, string DayKM)
        {
            return cmtdal.getAllambMaintain(ref totals, beginTime,  endTime,  DayKM);
        }

    }
}
